clear all
set more off
set memo 500m
set matsize 800
capture log close


cd ~/Crime

log using Sexratio_crime.log, text replace

********************************************************************************************
  
use UHS.dta, clear

tab year, ge(yd)

tab region, ge(pd)

ge cohort=year-age

tab cohort, ge(cd)

forvalues i=1(1)6 {

	g t`i'=pd`i'*year
	
	}

g lratio=ln(ratio)

g mlratio=male*lratio


global ed "edu col high mid employ professional lwage lincome"
	
********************************************************************************************

* Table 6

********************************************************************************************

foreach e in $ed {
eststo:   reg `e' lratio mlratio male    cd* yd* pd*  , cluster(region)
}


esttab using UHS.tex, label se ar2 title(Sex Ratios and Education and Labor Market Outcomes) addnote("Source: Urban Household Surveys, 1988-2006.") /*
      */ keep(mlratio lratio male) replace
eststo clear


foreach e in $ed {
eststo:   reg `e' lratio mlratio male   cd*   yd* pd* t*, cluster(region) 
}

esttab using UHS.tex, label se ar2 title(Sex Ratios and Education and Labor Market Outcomes -- time trend) addnote("Source: Urban Household Surveys, 1988-2006.") /*
     */ keep(mlratio lratio male)  append
eststo clear

********************************************************************************************

* Table V in Appendix B

********************************************************************************************

replace ratio=ratiob 
drop lratio 
drop mlratio
generate lratio=ln(ratio)
generate mlratio=lratio*male

foreach e in $ed {
eststo:   reg `e' lratio mlratio male    cd* yd* pd*  , cluster(region)
}

esttab using UHS_appendix.tex, label se ar2 title(Sex Ratios and Education and Labor Market Outcomes) /*
    */ addnote("Source: Urban Household Surveys, 1988-2006.") keep(mlratio lratio male) replace
eststo clear

foreach e in $ed {
eststo:   reg `e' lratio mlratio male   cd*   yd* pd* t*, cluster(region) 
}

esttab using UHS_appendix.tex, label se ar2 title(Sex Ratios and Education and Labor Market Outcomes -- time trend) addnote("Source: Urban Household Surveys, 1988-2006.") /*
    */ keep(mlratio lratio male) append
eststo clear

********************************************************************************************

log close 

exit, clear



















